package com.local.designpatterns.singletoninstance;

import com.org.javabody.Synchronized.Synchronized;

/**
 * //利用double lock 双重校验来创建单例模式
 * Created by Administrator on 2017-03-30.
 */
public class SingletonInstance {
    private SingletonInstance(){};
    private volatile SingletonInstance INSTANCE;

    public SingletonInstance getINSTANCE() {
        if(INSTANCE==null){
            synchronized (this){
                if(INSTANCE==null){
                    INSTANCE = new SingletonInstance();
                }
            }

        }
        return INSTANCE;
    }
}
